//
//  ILikedTextTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/4.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "ILikedTextTableViewCell.h"

@interface ILikedTextTableViewCell ()
{
    GLGWLabel *titleLab;
    GLGWLabel *detailLab;
}

@end

@implementation ILikedTextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat titleX = kWidthProportion_In_iPhoneTriploid(15);
        CGFloat titleY = kHeightProportion_In_iPhoneTriploid(15);
        CGFloat titleW = KScreenWidth - titleX * 2;
        CGFloat titleH = kHeightProportion_In_iPhoneTriploid(46);
        GLGWLabel *label = [[GLGWLabel alloc] initWithFrame:CGRectMake(titleX, titleY, titleW, titleH) theFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self.contentView];
        label.text = @"预测，2040年前我国天然气需求将处于高速增长预测，2040年前我国天然气需求将处于高速增长";
        label.numberOfLines = 2;
        titleLab = label;
        
        CGFloat title2X = label.x;
        CGFloat title2Y = kY_With_View(label, 10);
        CGFloat title2W = KScreenWidth - titleX * 2;
        CGFloat title2H = kHeightProportion_In_iPhoneTriploid(20);
        GLGWLabel *label2 = [[GLGWLabel alloc] initWithFrame:CGRectMake(title2X, title2Y, title2W, title2H) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self.contentView];
        label2.text = @"2人阅读 30人喜欢 20评论 12:00";
        detailLab = label2;
        
        self.selectionStyle = UITableViewCellSelectionStyleBlue;
        UIView *seleView = [[UIView alloc] init];
        seleView.backgroundColor = [UIColor clearColor];
        self.selectedBackgroundView = seleView;
        self.multipleSelectionBackgroundView = seleView;
    }
    return self;
}

- (void)setTitleStr:(NSString *)titleStr
{
    _titleStr = titleStr;
    titleLab.text = titleStr;
}

- (void)setDetailStr:(NSString *)detailStr
{
    _detailStr = detailStr;
    detailLab.text = detailStr;
}

- (void)setSelectedBackgroundView:(UIView *)selectedBackgroundView
{
    selectedBackgroundView.backgroundColor = [UIColor clearColor];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    if (!self.editing) {
        return;
    }
    [super setSelected:selected animated:animated];
    
    if (self.editing) {
//        arLabel.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
    }
    self.tintColor = [UIColor colorWithHexString:@"#A89A60"];
}

@end
